/*
 * ThreadHybridSystemController.h
 *
 *  Created on: Jan 27, 2013
 *      Author: Drew Prevost
 */

#ifndef THREADHYBRIDSYSTEMCONTROLLER_H_
#define THREADHYBRIDSYSTEMCONTROLLER_H_

#include <Protothread.h>
#include "Arduino.h"
#include "ThreadKeepCharged.h"
#include "ThreadDriveController.h"

class ThreadHybridSystemController: public Protothread
{
public:
  ThreadHybridSystemController(
                                uint8_t nKcVmPin,
                                int nKcVmPinMin,
                                int nKcVmPinMax,
                                int nKcVmVoltsMin,
                                int nKcVmVoltsMax,
                                unsigned long nKcVmReadFreqMicros,
                                uint8_t nKcEngServoPin,
                                unsigned long nKcEngServoMaxSpeedInMicrosPerDegree,
                                unsigned int nKcEngServoInitialPosition,
                                uint8_t nKcEngPinGlowPlug,
                                uint8_t nKcEngPinGenConnect,
                                uint8_t nKcEngPinStarterMotor,
                                uint8_t nKcEngPinGenDisonnect,
                                uint8_t nKcEngPinGenMonitor,
                                int nDcTachPin,
                                int nDcTachIrqNum,
                                int nDcTachIsrPin,
                                int nDcTachIsrMode,
                                int nDcMotorPin,
                                int nDcServoPin,
                                unsigned long nDcServoMaxSpeedInMicrosPerDegree,
                                unsigned int nDcServoInitialPosition,
                                unsigned int nDcServoInitialRateInDegPerSec );
  virtual ~ThreadHybridSystemController();

  virtual bool run();

protected:
  ThreadKeepCharged threadKeepCharged;
  ThreadDriveController threadDriveController;

};

#endif /* THREADHYBRIDSYSTEMCONTROLLER_H_ */
